
#ifndef __FFMPEG_SERVICE_H__
#define __FFMPEG_SERVICE_H__

#include "ffmpeg.pb.h"

typedef ffmpeg::CRPCProtocol_ErrorCode (*fn_cpp_invoke)(ffmpeg::CRPCProtocol& request, ffmpeg::CRPCProtocol& response);

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



class FFmpegServiceServiceImpl
{
public:
  
    virtual ffmpeg::CRPCProtocol_ErrorCode SayHello(const ffmpeg::HelloRequest& request,  ffmpeg::HelloReply& response);
  
    virtual ffmpeg::CRPCProtocol_ErrorCode DemuxerOpen(const ffmpeg::DemuxerOpenRequest& request,  ffmpeg::DemuxerOpenReply& response);
  
    virtual ffmpeg::CRPCProtocol_ErrorCode DemuxerClose(const ffmpeg::DemuxerCloseRequest& request,  ffmpeg::DemuxerCloseReply& response);
  
    virtual ffmpeg::CRPCProtocol_ErrorCode DemuxerReadPacket(const ffmpeg::DemuxerReadPacketRequest& request,  ffmpeg::DemuxerReadPacketReply& response);
  

public:
  void OnInvoke(ffmpeg::CRPCProtocol& request, ffmpeg::CRPCProtocol& response, fn_cpp_invoke on_invoke);
};

FFmpegServiceServiceImpl* GetFFmpegServiceServiceImpl();
void SetFFmpegServiceServiceImpl(FFmpegServiceServiceImpl* ins);



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////




class FFmpegServiceClient
{
public:
    FFmpegServiceClient() { invoke = 0; }
    fn_cpp_invoke invoke;

private:
    ffmpeg::CRPCProtocol_ErrorCode m_invoke(const std::string& method, const google::protobuf::Message& request, google::protobuf::Message& response, ffmpeg::CRPCProtocol* out);

public:
  
    ffmpeg::CRPCProtocol_ErrorCode SayHello(const ffmpeg::HelloRequest& request, ffmpeg::HelloReply& response, ffmpeg::CRPCProtocol* out = NULL);
  
    ffmpeg::CRPCProtocol_ErrorCode DemuxerOpen(const ffmpeg::DemuxerOpenRequest& request, ffmpeg::DemuxerOpenReply& response, ffmpeg::CRPCProtocol* out = NULL);
  
    ffmpeg::CRPCProtocol_ErrorCode DemuxerClose(const ffmpeg::DemuxerCloseRequest& request, ffmpeg::DemuxerCloseReply& response, ffmpeg::CRPCProtocol* out = NULL);
  
    ffmpeg::CRPCProtocol_ErrorCode DemuxerReadPacket(const ffmpeg::DemuxerReadPacketRequest& request, ffmpeg::DemuxerReadPacketReply& response, ffmpeg::CRPCProtocol* out = NULL);
  
};


FFmpegServiceClient* GetFFmpegServiceClinet();
void SetFFmpegServiceClinetInvoke(fn_cpp_invoke invoke);



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



#endif //  __FFMPEG_SERVICE_H__


